<%-- 
    Document   : TabelaHistorico
    Created on : 07/03/2012, 14:53:55
    Author     : Plínio Mos
--%>

<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.ArrayList"%>
<%@page import="br.catraca.modelo.RegistroEntrada"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="Estilos/EstiloTBLhistoricoDetalhes.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
</head>

<body topmargin="0" leftmargin="0">
    
    <% List < RegistroEntrada> registroEntrada = (List<RegistroEntrada>) session.getAttribute("registro_entrada"); %>    
    <% if (registroEntrada.get(0).getNome().equals("Vazio")){ %>
<table width="275" border="0" cellspacing="0">
    <tr id="cabecalhoHist">
        <td width="80">Selecione Um Departamento</td>
    </tr>
    <tr id="cabecalhoHist">
        <td width="80">e Clique Em Um Funcionário</td>
    </tr>
</table><%} else {%>
<% DateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");
DateFormat formatador2 = new SimpleDateFormat("HH:mm"); %>
<table width="275" border="0" cellspacing="0">
  <% for (int index = 0; index < registroEntrada.size() ; index ++){ %>
  <tr id="cabecalhoHist">
        <td width="80"><%=registroEntrada.get(index).getSituacao()%></td>
        <td width="100"><%=formatador.format(registroEntrada.get(index).getEntrada()) %></td>
         <td width="100"><%=formatador2.format(registroEntrada.get(index).getEntrada())%></td>
    </tr><%} %>
</table>
    <% registroEntrada.get(0).setNome("Vazio"); %>
    <% session.setAttribute("registro_entrada", registroEntrada); %>
    <%} %>
</body>

</html>
